package 栈;

import javax.crypto.spec.PSource;
import java.util.Stack;

public class Demo1 {
    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(3);
        int pop = stack.pop();
    }


    public static void main(String[] args) {
        MyStack<Integer> myStack = new MyStack<>();
        MyStack<String>  myStack2 = new MyStack<>();
        myStack.push(1);
        myStack.push(2);
        myStack.push(3);
        myStack2.push("sss");
        myStack2.push("jjj");

        System.out.println(myStack.peek());
        System.out.println(myStack.pop());
        System.out.println(myStack.pop());
        System.out.println(myStack.pop());
        System.out.println(myStack.isEmpty());
        //System.out.println(myStack.pop());
        System.out.println(myStack2.pop());
        System.out.println(myStack2.pop());
    }
}
